package com.itmake.sample.datascope.handler;

import cn.hutool.core.thread.ThreadUtil;

/**
 * 当前线程的数据权限处理
 *
 * @author Amjacks
 * @since 2023/08/10
 */
public class DataScopeHandler {

    private DataScopeHandler() {}

    private static final ThreadLocal<String> context = ThreadUtil.createThreadLocal(false);

    public static void set(String sql) {
        context.set(sql);
    }

    public static String get() {
        return context.get();
    }

    public static void remove() {
        context.remove();
    }
}
